package net.xju.controller;

import net.xju.common.framework.simplemvc.RequestMapping;
import net.xju.common.utils.JSONUtil;
import net.xju.common.utils.Result;
import net.xju.entity.Consultant;
import net.xju.service.ConsultantService;
import net.xju.service.impl.ConsultantServiceImpl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;

@RequestMapping("/api")
public class UserController {
    private ConsultantService consultantService = new ConsultantServiceImpl();

    @RequestMapping("/")
    public void consultantList(HttpServletRequest req, HttpServletResponse resp) throws UnsupportedEncodingException {
        JSONUtil.printByJSON(resp, Result.success(consultantService.list()));
    }
}